#include <stdio.h>

int main(void)
{
	int time, add;
	scanf("%d %d", &time, &add);
	int hh = time / 100;
	int mm = time % 100;
	mm = mm + add;

	if (mm > 59) { //分钟大于59进位
		hh += mm / 60;
		mm %= 60;
	}
	else if (mm < 0) { //分钟为负数扣小时
		hh -= 1;
		hh += mm / 60;
		mm %= 60;
		mm = mm + 60;	
	}
	
	printf("%d%02d", hh, mm);

	return 0;
}